<template>
	<view class="inspectContent">
		<nav-bar title="推荐检查"></nav-bar>
		<view class="centre"  >
			<z-paging ref="paging" autowire-list-name="companyList" autowire-query-name="listData" :created-reload="true" :how-refresher-when-reload="true"  :auto="true" >
				<view class="li" v-for="(list, index) in companyList" :key="index" @tap="toCheck(list.ID,list.IS_AUTHORITY,list.PROCESS_RESULTS)" >
					<view class="float">{{ list.PROCESS_NAME }}</view>
					<view class="h1">{{ index + 1 }}.{{ list.COMPANY_NAME }}</view>
					<view class="h2">风险等级:{{ list.RISK_LEVEL }}</view>
					<view class="h2" >许可证号:{{ list.LICENSE }}</view>
					<view class="h2" >所属区局:{{ list.DEPT_QU_NAME }}</view>
					<view class="h2" >监管单位:{{ list.DEPT_NAME }}</view>  
				</view>
			</z-paging>
		</view> 
	</view>
</template>

<script>
	import navBar from '../../components/CommonNavBar.vue';
	export default {
		components: {
			 navBar:navBar
		},
		data() {
			return {   
				searchParams:{
					typeCode:null 
				},
				companyList: [] 
			}
		},
		onLoad(options) { 
			this.searchParams.typeCode = options.typeCode 
		},  
		methods: { 
			async listData(pageNo, pageSize,reload) { 
				this.searchParams.pageNum = pageNo;
				this.searchParams.pageSize= pageSize; 
				try { 
					const res = await uni.$api.getCompanyByType(this.searchParams); 
					this.$refs.paging.complete(res.data.data);
				}  catch (error) { 
					 this.$refs.paging.complete(false);
				}
				
			},
			toCheck(id,isAuthority,supProcess){
				if(isAuthority != '1'){
					//没有权限操作
					uni.showToast({
						icon:'error',
						title: '无操作权限',
						duration: 4000
					})
					// /return;
				} 
				uni.navigateTo({
					url: '/pages/inspect/addInspectTabs?companyId=' + id +"&supProcess="+supProcess 
				})
			}
		},
		watch: {
			
		},
	}
</script>

<style lang="scss">
	.inspectContent {
		background: #F9F9F9;
		height: calc(100vh - 195rpx);

		.upper {
			position: fixed;
			z-index: 1;
			top: 0;
			left: 0;
			width: 100%;
		}

		.centre { 
			height: calc(100vh - 280rpx);
			overflow-x: hidden; 
			
			.z-paging-content-fixed {
				padding: 115rpx 0 0 0;
			}

			.li {
				background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
				box-shadow: 0rpx 8rpx 15rpx 0rpx rgba(0, 0, 0, 0.05);
				border-radius: 15rpx;
				padding: 30rpx 30rpx 15rpx 28rpx;
				position: relative;
				margin: 13rpx 20rpx 0;

				.float {
					position: absolute;
					top: 0;
					right: 0;
					// width: 97rpx;
					padding: 0 10rpx;
					height: 46rpx;
					line-height: 46rpx;
					background: linear-gradient(180deg, #5DA1FF 0%, #0054C9 100%);
					border-radius: 0rpx 11rpx 0rpx 11rpx;
					font-size: 18rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #FFFFFF;
					text-align: center;
				}

				.h1 {
					font-size: 24rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #333333;
					line-height: 1;
					margin: 0 0 14rpx 0;
				}

				.h2 {
					font-size: 19rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #666666;
					line-height: 1;
					margin: 12rpx auto;
				}

			 }
		}

		 
	}
	 
	 
</style>
